import request from '@/request/request'

// 分页查询课程列表
export function pageLessons(params) {
  return request({
    url: '/api/lessons/admin/page',
    method: 'get',
    params
  })
}

// 根据教师ID获取课程列表
export function getLessonsByTeacherId(teacherId) {
  return request({
    url: `/api/lessons/teacher/${teacherId}`,
    method: 'get'
  })
}

// 新增课程
export function addLesson(data) {
  return request({
    url: '/api/lessons/admin/add',
    method: 'post',
    data
  })
}

// 更新课程
export function updateLesson(data) {
  return request({
    url: '/api/lessons/admin/update',
    method: 'put',
    data
  })
}

// 删除课程
export function deleteLesson(id) {
  return request({
    url: `/api/lessons/admin/${id}`,
    method: 'delete'
  })
}

// 根据ID获取课程
export function getLessonById(id) {
  return request({
    url: `/api/lessons/admin/${id}`,
    method: 'get'
  })
} 